class Solution:
    duiying_dic = {"2": ["a", "b", "c"], "3": ["d", "e", "f"], "4": ["g", "h", "i"], "5": ["j", "k", "l"],
                   "6": ["m", "n", "o"], "7": ["p", "q", "r", "s"], "8": ["t", "u", "v"], "9": ["w", "x", "y", "z"]}

    def letterCombinations(self, digits: str) -> list:
        if not digits:
            return []
        res = [""]
        for s in digits:
            mid_res = []
            for str in res:
                for alp in Solution.duiying_dic[s]:
                    mid_res.append(str + alp)
            res = mid_res
        return res


a = Solution()
print(a.letterCombinations("23"))
